3.1.10 \(\int \frac {\cos ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx\) [10]

Optimal. Leaf size=230 \[ -\frac {x}{c}-\frac {\sqrt {2} \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}} \tan ^{-1}\left (\frac {2 c+\left (b-\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}}}\right )}{c \sqrt {b^2-4 a c}}+\frac {\sqrt {2} \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}} \tan ^{-1}\left (\frac {2 c+\left (b+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}}}\right )}{c \sqrt {b^2-4 a c}} \]

[Out]

-x/c-arctan(1/2*(2*c+(b-(-4*a*c+b^2)^(1/2))*tan(1/2*x))*2^(1/2)/(b^2-2*c*(a+c)-b*(-4*a*c+b^2)^(1/2))^(1/2))*2^
(1/2)*(b^2-2*c*(a+c)-b*(-4*a*c+b^2)^(1/2))^(1/2)/c/(-4*a*c+b^2)^(1/2)+arctan(1/2*(2*c+(b+(-4*a*c+b^2)^(1/2))*t
an(1/2*x))*2^(1/2)/(b^2-2*c*(a+c)+b*(-4*a*c+b^2)^(1/2))^(1/2))*2^(1/2)*(b^2-2*c*(a+c)+b*(-4*a*c+b^2)^(1/2))^(1
/2)/c/(-4*a*c+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.39, antiderivative size = 230, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3347, 3373, 2739, 632, 210} \begin {gather*} -\frac {\sqrt {2} \sqrt {-b \sqrt {b^2-4 a c}-2 c (a+c)+b^2} \text {ArcTan}\left (\frac {\tan \left (\frac {x}{2}\right ) \left (b-\sqrt {b^2-4 a c}\right )+2 c}{\sqrt {2} \sqrt {-b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}\right )}{c \sqrt {b^2-4 a c}}+\frac {\sqrt {2} \sqrt {b \sqrt {b^2-4 a c}-2 c (a+c)+b^2} \text {ArcTan}\left (\frac {\tan \left (\frac {x}{2}\right ) \left (\sqrt {b^2-4 a c}+b\right )+2 c}{\sqrt {2} \sqrt {b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}\right )}{c \sqrt {b^2-4 a c}}-\frac {x}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]^2/(a + b*Sin[x] + c*Sin[x]^2),x]

[Out]

-(x/c) - (Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]]*ArcTan[(2*c + (b - Sqrt[b^2 - 4*a*c])*Tan[x/2]
)/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]])])/(c*Sqrt[b^2 - 4*a*c]) + (Sqrt[2]*Sqrt[b^2 - 2*c*(a
 + c) + b*Sqrt[b^2 - 4*a*c]]*ArcTan[(2*c + (b + Sqrt[b^2 - 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) +
 b*Sqrt[b^2 - 4*a*c]])])/(c*Sqrt[b^2 - 4*a*c])

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2739

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[2*(e/d), Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 3347

Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*sin[(d_.) + (e_.)*(x_)]^(n_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]
^(n2_.))^(p_.), x_Symbol] :> Int[ExpandTrig[(1 - sin[d + e*x]^2)^(m/2)*(a + b*sin[d + e*x]^n + c*sin[d + e*x]^
(2*n))^p, x], x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[n2, 2*n] && IntegerQ[m/2] && NeQ[b^2 - 4*a*c, 0] && Integ
ersQ[n, p]

Rule 3373

Int[((A_) + (B_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + (b_.)*sin[(d_.) + (e_.)*(x_)] + (c_.)*sin[(d_.) + (e_.)*(x
_)]^2), x_Symbol] :> Module[{q = Rt[b^2 - 4*a*c, 2]}, Dist[B + (b*B - 2*A*c)/q, Int[1/(b + q + 2*c*Sin[d + e*x
]), x], x] + Dist[B - (b*B - 2*A*c)/q, Int[1/(b - q + 2*c*Sin[d + e*x]), x], x]] /; FreeQ[{a, b, c, d, e, A, B
}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin {align*} \int \frac {\cos ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx &=\int \left (-\frac {1}{c}+\frac {a \left (1+\frac {c}{a}\right )+b \sin (x)}{c \left (a+b \sin (x)+c \sin ^2(x)\right )}\right ) \, dx\\ &=-\frac {x}{c}+\frac {\int \frac {a \left (1+\frac {c}{a}\right )+b \sin (x)}{a+b \sin (x)+c \sin ^2(x)} \, dx}{c}\\ &=-\frac {x}{c}+\frac {\left (b-\frac {b^2-2 c (a+c)}{\sqrt {b^2-4 a c}}\right ) \int \frac {1}{b-\sqrt {b^2-4 a c}+2 c \sin (x)} \, dx}{c}+\frac {\left (b+\frac {b^2-2 c (a+c)}{\sqrt {b^2-4 a c}}\right ) \int \frac {1}{b+\sqrt {b^2-4 a c}+2 c \sin (x)} \, dx}{c}\\ &=-\frac {x}{c}+\frac {\left (2 \left (b-\frac {b^2-2 c (a+c)}{\sqrt {b^2-4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{b-\sqrt {b^2-4 a c}+4 c x+\left (b-\sqrt {b^2-4 a c}\right ) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{c}+\frac {\left (2 \left (b+\frac {b^2-2 c (a+c)}{\sqrt {b^2-4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{b+\sqrt {b^2-4 a c}+4 c x+\left (b+\sqrt {b^2-4 a c}\right ) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{c}\\ &=-\frac {x}{c}-\frac {\left (4 \left (b-\frac {b^2-2 c (a+c)}{\sqrt {b^2-4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{-8 \left (b^2-2 c (a+c)-b \sqrt {b^2-4 a c}\right )-x^2} \, dx,x,4 c+2 \left (b-\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )\right )}{c}-\frac {\left (4 \left (b+\frac {b^2-2 c (a+c)}{\sqrt {b^2-4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{4 \left (4 c^2-\left (b+\sqrt {b^2-4 a c}\right )^2\right )-x^2} \, dx,x,4 c+2 \left (b+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )\right )}{c}\\ &=-\frac {x}{c}-\frac {\sqrt {2} \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}} \tan ^{-1}\left (\frac {2 c+\left (b-\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}}}\right )}{c \sqrt {b^2-4 a c}}+\frac {\sqrt {2} \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}} \tan ^{-1}\left (\frac {2 c+\left (b+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}}}\right )}{c \sqrt {b^2-4 a c}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.28, size = 314, normalized size = 1.37 \begin {gather*} \frac {-x+\frac {\left (i b^2-2 i c (a+c)+b \sqrt {-b^2+4 a c}\right ) \tan ^{-1}\left (\frac {2 c+\left (b-i \sqrt {-b^2+4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-i b \sqrt {-b^2+4 a c}}}\right )}{\sqrt {-\frac {b^2}{2}+2 a c} \sqrt {b^2-2 c (a+c)-i b \sqrt {-b^2+4 a c}}}+\frac {\left (-i b^2+2 i c (a+c)+b \sqrt {-b^2+4 a c}\right ) \tan ^{-1}\left (\frac {2 c+\left (b+i \sqrt {-b^2+4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+i b \sqrt {-b^2+4 a c}}}\right )}{\sqrt {-\frac {b^2}{2}+2 a c} \sqrt {b^2-2 c (a+c)+i b \sqrt {-b^2+4 a c}}}}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^2/(a + b*Sin[x] + c*Sin[x]^2),x]

[Out]

(-x + ((I*b^2 - (2*I)*c*(a + c) + b*Sqrt[-b^2 + 4*a*c])*ArcTan[(2*c + (b - I*Sqrt[-b^2 + 4*a*c])*Tan[x/2])/(Sq
rt[2]*Sqrt[b^2 - 2*c*(a + c) - I*b*Sqrt[-b^2 + 4*a*c]])])/(Sqrt[-1/2*b^2 + 2*a*c]*Sqrt[b^2 - 2*c*(a + c) - I*b
*Sqrt[-b^2 + 4*a*c]]) + (((-I)*b^2 + (2*I)*c*(a + c) + b*Sqrt[-b^2 + 4*a*c])*ArcTan[(2*c + (b + I*Sqrt[-b^2 +
4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) + I*b*Sqrt[-b^2 + 4*a*c]])])/(Sqrt[-1/2*b^2 + 2*a*c]*Sqrt[b^
2 - 2*c*(a + c) + I*b*Sqrt[-b^2 + 4*a*c]]))/c

________________________________________________________________________________________

Maple [A]
time = 0.62, size = 320, normalized size = 1.39

method result size
risch \(-\frac {x}{c}+\left (\munderset {\textit {\_R} =\RootOf \left (\left (16 a^{2} c^{4}-8 a \,b^{2} c^{3}+b^{4} c^{2}\right ) \textit {\_Z}^{4}+\left (8 a^{2} c^{2}-6 a \,b^{2} c +8 a \,c^{3}+b^{4}-2 b^{2} c^{2}\right ) \textit {\_Z}^{2}+a^{2}+2 a c -b^{2}+c^{2}\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{i x}+\left (\frac {8 c^{3} a}{b}-2 b \,c^{2}\right ) \textit {\_R}^{3}+\left (\frac {4 i a \,c^{2}}{b}-i b c \right ) \textit {\_R}^{2}+\left (\frac {2 a c}{b}-b +\frac {2 c^{2}}{b}\right ) \textit {\_R} +\frac {i a}{b}+\frac {i c}{b}\right )\right )\) \(178\)
default \(-\frac {2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{c}+\frac {2 a \left (-\frac {\left (-\sqrt {-4 a c +b^{2}}\, b a +\sqrt {-4 a c +b^{2}}\, b c +4 a^{2} c -a \,b^{2}+4 a \,c^{2}-b^{2} c \right ) \arctan \left (\frac {-2 a \tan \left (\frac {x}{2}\right )+\sqrt {-4 a c +b^{2}}-b}{\sqrt {4 a c -2 b^{2}+2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{a \left (4 a c -b^{2}\right ) \sqrt {4 a c -2 b^{2}+2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}+\frac {\left (\sqrt {-4 a c +b^{2}}\, b a -\sqrt {-4 a c +b^{2}}\, b c +4 a^{2} c -a \,b^{2}+4 a \,c^{2}-b^{2} c \right ) \arctan \left (\frac {2 a \tan \left (\frac {x}{2}\right )+b +\sqrt {-4 a c +b^{2}}}{\sqrt {4 a c -2 b^{2}-2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{a \left (4 a c -b^{2}\right ) \sqrt {4 a c -2 b^{2}-2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{c}\) \(320\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a+b*sin(x)+c*sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

-2/c*arctan(tan(1/2*x))+2/c*a*(-(-(-4*a*c+b^2)^(1/2)*b*a+(-4*a*c+b^2)^(1/2)*b*c+4*a^2*c-a*b^2+4*a*c^2-b^2*c)/a
/(4*a*c-b^2)/(4*a*c-2*b^2+2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/2)*arctan((-2*a*tan(1/2*x)+(-4*a*c+b^2)^(1/2)-b)/(4
*a*c-2*b^2+2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/2))+((-4*a*c+b^2)^(1/2)*b*a-(-4*a*c+b^2)^(1/2)*b*c+4*a^2*c-a*b^2+4
*a*c^2-b^2*c)/a/(4*a*c-b^2)/(4*a*c-2*b^2-2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/2)*arctan((2*a*tan(1/2*x)+b+(-4*a*c+
b^2)^(1/2))/(4*a*c-2*b^2-2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/2)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+b*sin(x)+c*sin(x)^2),x, algorithm="maxima")

[Out]

(c*integrate(2*(2*b^2*cos(3*x)^2 + 2*b^2*cos(x)^2 + 2*b^2*sin(3*x)^2 + 2*b^2*sin(x)^2 + 4*(2*a^2 + 3*a*c + c^2
)*cos(2*x)^2 + 2*(4*a*b + 3*b*c)*cos(x)*sin(2*x) + 4*(2*a^2 + 3*a*c + c^2)*sin(2*x)^2 + b*c*sin(x) - (b*c*sin(
3*x) - b*c*sin(x) + 2*(a*c + c^2)*cos(2*x))*cos(4*x) - 2*(2*b^2*cos(x) + (4*a*b + 3*b*c)*sin(2*x))*cos(3*x) -
2*(a*c + c^2 + (4*a*b + 3*b*c)*sin(x))*cos(2*x) + (b*c*cos(3*x) - b*c*cos(x) - 2*(a*c + c^2)*sin(2*x))*sin(4*x
) - (4*b^2*sin(x) + b*c - 2*(4*a*b + 3*b*c)*cos(2*x))*sin(3*x))/(c^3*cos(4*x)^2 + 4*b^2*c*cos(3*x)^2 + 4*b^2*c
*cos(x)^2 + c^3*sin(4*x)^2 + 4*b^2*c*sin(3*x)^2 + 4*b^2*c*sin(x)^2 + 4*b*c^2*sin(x) + c^3 + 4*(4*a^2*c + 4*a*c
^2 + c^3)*cos(2*x)^2 + 8*(2*a*b*c + b*c^2)*cos(x)*sin(2*x) + 4*(4*a^2*c + 4*a*c^2 + c^3)*sin(2*x)^2 - 2*(2*b*c
^2*sin(3*x) - 2*b*c^2*sin(x) - c^3 + 2*(2*a*c^2 + c^3)*cos(2*x))*cos(4*x) - 8*(b^2*c*cos(x) + (2*a*b*c + b*c^2
)*sin(2*x))*cos(3*x) - 4*(2*a*c^2 + c^3 + 2*(2*a*b*c + b*c^2)*sin(x))*cos(2*x) + 4*(b*c^2*cos(3*x) - b*c^2*cos
(x) - (2*a*c^2 + c^3)*sin(2*x))*sin(4*x) - 4*(2*b^2*c*sin(x) + b*c^2 - 2*(2*a*b*c + b*c^2)*cos(2*x))*sin(3*x))
, x) - x)/c

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 971 vs. \(2 (196) = 392\).
time = 0.46, size = 971, normalized size = 4.22 \begin {gather*} \frac {\sqrt {2} c \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \log \left (\sqrt {2} {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \cos \left (x\right ) + b^{2} \sin \left (x\right ) + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sin \left (x\right ) + 2 \, b c\right ) - \sqrt {2} c \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \log \left (\sqrt {2} {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \cos \left (x\right ) - b^{2} \sin \left (x\right ) - {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sin \left (x\right ) - 2 \, b c\right ) - \sqrt {2} c \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} - {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \log \left (\sqrt {2} {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} - {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \cos \left (x\right ) + b^{2} \sin \left (x\right ) - {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sin \left (x\right ) + 2 \, b c\right ) + \sqrt {2} c \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} - {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \log \left (\sqrt {2} {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sqrt {-\frac {b^{2} - 2 \, a c - 2 \, c^{2} - {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}}}{b^{2} c^{2} - 4 \, a c^{3}}} \cos \left (x\right ) - b^{2} \sin \left (x\right ) + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt {\frac {b^{2}}{b^{2} c^{4} - 4 \, a c^{5}}} \sin \left (x\right ) - 2 \, b c\right ) - 4 \, x}{4 \, c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+b*sin(x)+c*sin(x)^2),x, algorithm="fricas")

[Out]

1/4*(sqrt(2)*c*sqrt(-(b^2 - 2*a*c - 2*c^2 + (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*
c^3))*log(sqrt(2)*(b^2*c^3 - 4*a*c^4)*sqrt(b^2/(b^2*c^4 - 4*a*c^5))*sqrt(-(b^2 - 2*a*c - 2*c^2 + (b^2*c^2 - 4*
a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*c^3))*cos(x) + b^2*sin(x) + (b^2*c^2 - 4*a*c^3)*sqrt(b^2/
(b^2*c^4 - 4*a*c^5))*sin(x) + 2*b*c) - sqrt(2)*c*sqrt(-(b^2 - 2*a*c - 2*c^2 + (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^
2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*c^3))*log(sqrt(2)*(b^2*c^3 - 4*a*c^4)*sqrt(b^2/(b^2*c^4 - 4*a*c^5))*sqrt(-(b
^2 - 2*a*c - 2*c^2 + (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*c^3))*cos(x) - b^2*sin(
x) - (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5))*sin(x) - 2*b*c) - sqrt(2)*c*sqrt(-(b^2 - 2*a*c - 2*c^2
- (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*c^3))*log(sqrt(2)*(b^2*c^3 - 4*a*c^4)*sqrt
(b^2/(b^2*c^4 - 4*a*c^5))*sqrt(-(b^2 - 2*a*c - 2*c^2 - (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2
*c^2 - 4*a*c^3))*cos(x) + b^2*sin(x) - (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5))*sin(x) + 2*b*c) + sqr
t(2)*c*sqrt(-(b^2 - 2*a*c - 2*c^2 - (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*c^3))*lo
g(sqrt(2)*(b^2*c^3 - 4*a*c^4)*sqrt(b^2/(b^2*c^4 - 4*a*c^5))*sqrt(-(b^2 - 2*a*c - 2*c^2 - (b^2*c^2 - 4*a*c^3)*s
qrt(b^2/(b^2*c^4 - 4*a*c^5)))/(b^2*c^2 - 4*a*c^3))*cos(x) - b^2*sin(x) + (b^2*c^2 - 4*a*c^3)*sqrt(b^2/(b^2*c^4
 - 4*a*c^5))*sin(x) - 2*b*c) - 4*x)/c

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**2/(a+b*sin(x)+c*sin(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+b*sin(x)+c*sin(x)^2),x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

Mupad [B]
time = 26.30, size = 2500, normalized size = 10.87 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a + c*sin(x)^2 + b*sin(x)),x)

[Out]

atan(((-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*
c^2 - 8*a*b^2*c^3)))^(1/2)*(tan(x/2)*(81920*a*b^4 + 139264*a*c^4 + 196608*a^4*c + 24576*a^5 - 98304*a^3*b^2 +
425984*a^2*c^3 + 458752*a^3*c^2 - 212992*a*b^2*c^2 - 327680*a^2*b^2*c) - 24576*a^4*b + 32768*a^2*b^3 + (-(8*a*
c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2 - 8*a*b^2
*c^3)))^(1/2)*((-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c
^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*((-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6
*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*((-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a
^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*(tan(x/2)*(524288*a^2*c^7 + 11
79648*a^3*c^6 + 851968*a^4*c^5 + 196608*a^5*c^4 - 131072*a*b^2*c^6 + 139264*a*b^4*c^4 - 16384*a*b^6*c^2 - 8519
68*a^2*b^2*c^5 + 147456*a^2*b^4*c^3 - 540672*a^3*b^2*c^4 + 16384*a^3*b^4*c^2 - 114688*a^4*b^2*c^3) - 32768*a*b
^3*c^5 + 24576*a*b^5*c^3 + 131072*a^2*b*c^6 + 163840*a^3*b*c^5 + 98304*a^4*b*c^4 - 139264*a^2*b^3*c^4 - 24576*
a^3*b^3*c^3) - tan(x/2)*(32768*a*b^5*c^2 - 32768*a*b^3*c^4 + 131072*a^2*b*c^5 + 262144*a^3*b*c^4 + 131072*a^4*
b*c^3 - 196608*a^2*b^3*c^3 - 32768*a^3*b^3*c^2) + 131072*a^2*c^6 + 163840*a^3*c^5 - 65536*a^4*c^4 - 98304*a^5*
c^3 - 32768*a*b^2*c^5 + 32768*a*b^4*c^3 - 172032*a^2*b^2*c^4 - 24576*a^2*b^4*c^2 + 114688*a^3*b^2*c^3 + 24576*
a^4*b^2*c^2) + tan(x/2)*(131072*a*c^6 - 16384*a*b^6 + 16384*a^3*b^4 + 983040*a^2*c^5 + 1654784*a^3*c^4 + 95027
2*a^4*c^3 + 147456*a^5*c^2 - 344064*a*b^2*c^4 + 229376*a*b^4*c^2 + 131072*a^2*b^4*c - 98304*a^4*b^2*c - 122880
0*a^2*b^2*c^3 - 540672*a^3*b^2*c^2) - 57344*a*b^3*c^3 + 139264*a^2*b*c^4 + 114688*a^3*b*c^3 - 24576*a^3*b^3*c
+ 73728*a^4*b*c^2 - 106496*a^2*b^3*c^2 + 32768*a*b*c^5 + 24576*a*b^5*c) - tan(x/2)*(32768*a*b^5 - 32768*a^3*b^
3 + 65536*a^2*b*c^3 - 196608*a^2*b^3*c + 229376*a^3*b*c^2 - 32768*a*b*c^4 + 131072*a^4*b*c) + 32768*a*c^5 - 24
576*a^5*c - 8192*a^2*b^4 + 8192*a^4*b^2 + 172032*a^2*c^4 + 221184*a^3*c^3 + 57344*a^4*c^2 - 57344*a*b^2*c^3 +
16384*a^3*b^2*c - 147456*a^2*b^2*c^2 + 24576*a*b^4*c) + 8192*a^2*b*c^2 + 32768*a*b*c^3 - 24576*a*b^3*c - 49152
*a^3*b*c)*1i - (-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c
^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*(24576*a^4*b - tan(x/2)*(81920*a*b^4 + 139264*a*c^4 + 196608*a^4*c + 24576
*a^5 - 98304*a^3*b^2 + 425984*a^2*c^3 + 458752*a^3*c^2 - 212992*a*b^2*c^2 - 327680*a^2*b^2*c) - 32768*a^2*b^3
+ (-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2
- 8*a*b^2*c^3)))^(1/2)*(32768*a*c^5 - (-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 -
6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*((-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*
a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*((-(8*a*c^3 + b*(-(4*a*c - b^
2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*(16*a^2*c^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*(tan(x/
2)*(524288*a^2*c^7 + 1179648*a^3*c^6 + 851968*a^4*c^5 + 196608*a^5*c^4 - 131072*a*b^2*c^6 + 139264*a*b^4*c^4 -
 16384*a*b^6*c^2 - 851968*a^2*b^2*c^5 + 147456*a^2*b^4*c^3 - 540672*a^3*b^2*c^4 + 16384*a^3*b^4*c^2 - 114688*a
^4*b^2*c^3) - 32768*a*b^3*c^5 + 24576*a*b^5*c^3 + 131072*a^2*b*c^6 + 163840*a^3*b*c^5 + 98304*a^4*b*c^4 - 1392
64*a^2*b^3*c^4 - 24576*a^3*b^3*c^3) + tan(x/2)*(32768*a*b^5*c^2 - 32768*a*b^3*c^4 + 131072*a^2*b*c^5 + 262144*
a^3*b*c^4 + 131072*a^4*b*c^3 - 196608*a^2*b^3*c^3 - 32768*a^3*b^3*c^2) - 131072*a^2*c^6 - 163840*a^3*c^5 + 655
36*a^4*c^4 + 98304*a^5*c^3 + 32768*a*b^2*c^5 - 32768*a*b^4*c^3 + 172032*a^2*b^2*c^4 + 24576*a^2*b^4*c^2 - 1146
88*a^3*b^2*c^3 - 24576*a^4*b^2*c^2) + tan(x/2)*(131072*a*c^6 - 16384*a*b^6 + 16384*a^3*b^4 + 983040*a^2*c^5 +
1654784*a^3*c^4 + 950272*a^4*c^3 + 147456*a^5*c^2 - 344064*a*b^2*c^4 + 229376*a*b^4*c^2 + 131072*a^2*b^4*c - 9
8304*a^4*b^2*c - 1228800*a^2*b^2*c^3 - 540672*a^3*b^2*c^2) - 57344*a*b^3*c^3 + 139264*a^2*b*c^4 + 114688*a^3*b
*c^3 - 24576*a^3*b^3*c + 73728*a^4*b*c^2 - 106496*a^2*b^3*c^2 + 32768*a*b*c^5 + 24576*a*b^5*c) - tan(x/2)*(327
68*a*b^5 - 32768*a^3*b^3 + 65536*a^2*b*c^3 - 196608*a^2*b^3*c + 229376*a^3*b*c^2 - 32768*a*b*c^4 + 131072*a^4*
b*c) - 24576*a^5*c - 8192*a^2*b^4 + 8192*a^4*b^2 + 172032*a^2*c^4 + 221184*a^3*c^3 + 57344*a^4*c^2 - 57344*a*b
^2*c^3 + 16384*a^3*b^2*c - 147456*a^2*b^2*c^2 + 24576*a*b^4*c) - 8192*a^2*b*c^2 - 32768*a*b*c^3 + 24576*a*b^3*
c + 49152*a^3*b*c)*1i)/((-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 + 8*a^2*c^2 - 2*b^2*c^2 - 6*a*b^2*c)/(2*
(16*a^2*c^4 + b^4*c^2 - 8*a*b^2*c^3)))^(1/2)*(tan(x/2)*(81920*a*b^4 + 139264*a*c^4 + 196608*a^4*c + 24576*a^5
- 98304*a^3*b^2 + 425984*a^2*c^3 + 458752*a^3*c^2 - 212992*a*b^2*c^2 - 327680*a^2*b^2*c) - 24576*a^4*b + 32768
*a^2*b^3 + (-(8*a*c^3 + b*(-(4*a*c - b^2)^3)^(1...

________________________________________________________________________________________